# -*- coding: utf-8 -*-
import datetime
import time

from odoo import api, fields, models
import logging
_logger = logging.getLogger(__name__)


class Report(models.Model):
    _inherit = 'ir.actions.report'

    xml_combine = fields.Text(compute='_compute_xml_combine',
                              string='View Architecture')

    def _compute_xml_combine(self):
        for view in self:
            _id = view.model.replace('.', '_')
            _model = view.model
            _string = view.name
            _report_type = 'qweb-pdf'
            _name = view.name
            _file = 'modul_name.template_id'
            _print_report_name = view.print_report_name
            view.xml_combine = """<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report
            id="%s"
            model="%s"
            string="%s"
            report_type="%s"
            name="%s"
            file="%s"
            print_report_name="%s"
        />
    </data>
</openerp>
                                 """ % (_id, _model, _string, _report_type, _name, _file, _print_report_name)
